<template>
	<view>
		<web-view :src="externalLink[selType].src" />
	</view>
</template>

<script setup>
import { ref, onMounted } from "vue";
import { useI18n } from "vue-i18n";
import { onLoad } from "@dcloudio/uni-app";

const { t } = useI18n();
const selType = ref(0);
const externalLink = ref([
	{
		title: t("webView.title.0"),
		src: "https://docs.qq.com/doc/p/0f2c46ca63e9109504854fed22b2772cb0f1e49b?u=13c948668fbb42838ad8eaae17587e37",
	},
	{
		title: t("webView.title.1"),
		src: "https://docs.qq.com/doc/p/0016b614c4072a72bb51b136e77958d4f4510203?u=13c948668fbb42838ad8eaae17587e37",
	},
	{
		title: t("webView.title.2"),
		src: "https://alidocs.dingtalk.com/i/p/5YRBGv4Qo65WXDAr2RXD1NPDrLqZAmZj",
	},
]);

onLoad((options) => {
	selType.value = Number(options.type);
	uni.setNavigationBarTitle({
		title: externalLink.value[selType.value].title,
	});
});
</script>

<style lang="scss" scoped></style>
